﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using Stone.ServiceImpl.ServiceImpl;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace Stone.Host
{
    static class Program
    {
        [DllImport("User32.dll")]                                           //****添加windows函数****
        private static extern IntPtr FindWindow(String lpClassName, String lpWindowName);
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            IntPtr handle = FindWindow(null, "才子后台服务"); //****防止程序重复运行*****
            if (handle != (IntPtr)0)
            {
                MessageBox.Show("程序已运行");
                return;
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FormHost());
        }
    }
}
